// This is the main DLL file.

#include "stdafx.h"
#include "Calendar.h" 

//const string Calendar::fileInUse = "TExemplar.txt";
vector<Event*>* Calendar::eventList = new vector<Event*>;

Calendar::Calendar(){
	fileIO = new FileIO(getVector());
}

vector<Event*>* Calendar::getVector(){
	return eventList;
}

/*
void Calendar::initialiseFile(){
	if (!checkFileExists(getFileName())){
		createNewFile(getFileName());
	}
}

void Calendar::createNewFile(String^ fileName){
	FileStream^ fs = gcnew FileStream(fileName, FileMode::CreateNew);
	fs->Close();
}

String^ Calendar::getFileName(){
	String^ fileName = gcnew String(fileInUse.c_str());
	return fileName;
}

bool Calendar::checkFileExists(String^ fileName){
	return File::Exists(fileName);
}

TimeType Calendar::determineTimeType(int index){
	switch (index){
	case 1:
		return TimeType::SECOND;
		break;
	case 2:
		return TimeType::MINUTE;
		break;
	case 3: 
		return TimeType::HOUR;
		break;
	case 4:
		return TimeType::DAY;
		break;
	case 5:
		return TimeType::MONTH;
		break;
	case 6:
		return TimeType::YEAR;
		break;
	}
}

// This method converts integers to std::string.
string Calendar::convertToString(int index){           
	std::ostringstream convert;   
	convert << index;     
	return convert.str();
}

// This method converts system string to std::string.
string Calendar::convertToString(String^ toBeConverted){
	string convertedToString = marshal_as<std::string>(toBeConverted);
	return convertedToString;
}

// This method converts unsigned char ('Byte') to std::string
string Calendar::convertToString(CommonDataType::Byte byteVariable){
	std::stringstream ss;
	ss << byteVariable;
	return ss.str();
}

*/

//====================================end of Calendar class========================================//

/*
int main(){
	string nouse;
	
	Calendar calendar;
	std::cin >> nouse;

	return 0;
}
*/